<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>DoYouHaoBaby示例：CURD操作</title>
<link rel='stylesheet' type='text/css' href='{:__PUBLIC__}/Css/common.css'>
<import file="Js.Vendor.Jquery" />
<import file="Js.Dyhb#package" />
 </head>
 <body>

{script}
 <!--
	function add(){

		window.location.href="{:__URL__}/add";
	}
	function edit(id){

		window.location.href="{:__URL__}/edit/id/"+id;
	}
	function del(id){

		Dyhb.AjaxSend('{:__URL__}/del','ajax=1&id='+id,'result',complete);
	}
	function complete(data,status){

		if (status==1){
			$('#data_'+data.form_id).hide(3000);
		}
	}
 //-->
{/script}

 <div class="main">
 <h2>DoYouHaoBaby示例之：CURD操作</h2>
<div class="title">方便地完成对单表的CURD操作</div>
<p>
<input type="button" value="新 增" class="small" onClick="add()"><div id="result" class="none result" style="font-family:微软雅黑,Tahoma;letter-spacing:2px"></div></div></p>
<div class="line"></div>
<div class="article_list">
<div class="title">文章列表</div>
<ul id="list">
<foreach for=arrObjectList>
  <li id="data_{$value:form_id}">
	<div class="article_title">{$value:form_title}</div><div class="article_detail">[{$value:form_email} {$value:create_date|date='Y-m-d H:i:s',**}]<br/>
	<input type="button" value="编辑" class="small button" onClick="edit({$value:form_id})"> <input type="button" value="删除" class="small button" onClick="del({$value:form_id})"></div>
    <div class="content">{$value:form_content}</div>
  </li>
</foreach>
</ul>
</div>

<div class="line"></div>
 <div class="title">示例源码</div><br/><div class="li_title">控制器IndexControl类</div><br/>
 <div class="code"><php>highlight_file( APP_PATH.'/App/Class/Controller/IndexController.class.php')</php></div><br/>
 <div class="li_title">模型FormModel类</div><br/>
 <div class="code"><php>highlight_file( APP_PATH.'/App/Class/Model/FormModel.class.php')</php>
 </div>
</div>
 </body>
</html>
